package com.example.asus.db.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.asus.db.domain.Note;
import com.example.asus.db.domain.User;
import com.example.asus.db.domain.Password;

import com.example.asus.db.gen.NoteDao;
import com.example.asus.db.gen.UserDao;
import com.example.asus.db.gen.PasswordDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig noteDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig passwordDaoConfig;

    private final NoteDao noteDao;
    private final UserDao userDao;
    private final PasswordDao passwordDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        noteDaoConfig = daoConfigMap.get(NoteDao.class).clone();
        noteDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        passwordDaoConfig = daoConfigMap.get(PasswordDao.class).clone();
        passwordDaoConfig.initIdentityScope(type);

        noteDao = new NoteDao(noteDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        passwordDao = new PasswordDao(passwordDaoConfig, this);

        registerDao(Note.class, noteDao);
        registerDao(User.class, userDao);
        registerDao(Password.class, passwordDao);
    }
    
    public void clear() {
        noteDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        passwordDaoConfig.clearIdentityScope();
    }

    public NoteDao getNoteDao() {
        return noteDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public PasswordDao getPasswordDao() {
        return passwordDao;
    }

}
